package com.junzhiit.nengji.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum BookingType {
	RESERVATIONS(0,"订座"),
	ORDER(1,"点餐");
	
	private Integer value;
	private String text;
	
	private BookingType(int value,String text){
		this.value = value;
		this.text = text;
	}
	
	public Integer toIntValue(){
		return this.value;
	}
	
	public String toStringText(){
		return this.text;
	}
	
	public static BookingType toStatus(Integer value) {
		if (RESERVATIONS.value == value) {
			return RESERVATIONS;
		} else if (ORDER.value == value) {
			return ORDER;
		} else {
			throw new InvalidArgumentException("Unknown BookingType[" + value + "].");
		}
	}
}
